#!/bin/bash

LIBRARIES=-lgoo

CFLAGS=-Wall -g `pkg-config --cflags --libs gtk+-2.0` ${LIBRIES} -pthread 

PROGRAMS=wnetscan
MANPAGE=wnetscan.8
ZIPPEDPAGE=${MANPAGE}.gz

default: all
all:  ${PROGRAMS} 

wnetscan: wnetscan.C options.h ifcfg.h access_point.h cmd.h except.h

%: %.C
	g++ ${CFLAGS} -o $@ $< ${LIBRARIES}

clean:
	rm -f ${PROGRAMS} *.o

${MANPAGE}: wnetscan_man_page.src
	groff -man -Tascii $< > $@ 

${ZIPPEDPAGE}: ${MANPAGE}
	gzip $<

install:   ${PROGRAMS} 
	install ${PROGRAMS} /usr/local/sbin
	install ${ZIPPEDPAGE} /usr/share/man/man8
	echo "You may need to run mkwhatis to be able to use the man page"
